-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 [Feature]: Add ReleaseType input for explicit release control #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ReleaseType input for explicit release control
ReleaseType input for explicit release controlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new ReleaseType input parameter that provides explicit control over release creation, replacing the previous automatic detection based on pull request state and branch information. The feature enables callers (typically Get-PSModuleSettings) to specify whether to create a Release, Prerelease, Cleanup, or None.
Changes:
- Added
ReleaseTypeinput parameter to action.yml with default value 'Release' - Removed automatic detection logic for release types based on PR state, merge status, and target branch
- Added validation for the ReleaseType parameter with support for four values: Release, Prerelease, Cleanup, None
- Updated logging to display ReleaseType instead of PR state details
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| action.yml | Adds ReleaseType input parameter definition and environment variable mapping |
| scripts/helpers/Publish-PSModule.ps1 | Replaces automatic release type detection with explicit ReleaseType input handling and validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ng related variables for clarity
…le/Publish-PSModule into feature/releasetype-input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…load-artifact action version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…anup and update related logic
…ng PUBLISH_CONTEXT_PrereleaseName
… as it is in init
…ror handling and clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ewVersion and refactor manifest validation region
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The action now supports explicit control over the release type through the new
ReleaseTypeinput parameter. The workflow has been restructured into separate initialization, publishing, and cleanup phases for improved modularity and conditional execution.New ReleaseType input parameter
The
ReleaseTypeinput accepts the following values:ReleasePrereleaseNoneThe cleanup of old prereleases is controlled separately via the existing
AutoCleanupinput.Restructured workflow execution
The action is now split into three conditional phases:
init.ps1) - Calculates version, validates inputs, and stores context in environment variablespublish.ps1) - Downloads artifact, updates manifest, publishes to PSGallery, and creates GitHub release (only runs whenShouldPublishis true)cleanup.ps1) - Deletes old prerelease tags (only runs whenShouldCleanupis true)This separation allows the action to skip unnecessary steps (e.g., downloading artifacts when only cleanup is needed), and enables the abandoned PR cleanup scenario where a PR is closed without merging—the workflow can trigger cleanup independently of whether a release is being created.
Usage
The inputs work together with
Get-PSModuleSettingswhich pre-calculates both values:Backward compatibility
The
ReleaseTypeparameter defaults toRelease, maintaining current behavior for merged PRs targeting the default branch.